﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Runtime.InteropServices.WindowsRuntime;
using Windows.UI.Xaml;
using Windows.UI.Xaml.Controls;
using Windows.UI.Xaml.Data;
using Windows.UI.Xaml.Documents;
using Windows.UI.Xaml.Input;
using Windows.UI.Xaml.Media;
using 纸片人.CalculateControls;
using 纸片人.win2dEffectControl.DataClass;


// The Templated Control item template is documented at https://go.microsoft.com/fwlink/?LinkId=234235

namespace 纸片人.win2dEffectControl
{
    public  class BrightnessEffectControl : EffectControl
    {

        Vector2Control blackPointVector2Contrl;
        Vector2Control whitePointVector2Contrl;

        public override EffectOneSourceData OneEffetData { get; set; }


        public BrightnessEffectControl()
        {
            this.DefaultStyleKey = typeof(BrightnessEffectControl);
            OneEffetData = new BrightnessEffectData();
        }

        protected override void OnApplyTemplate()
        {
            base.OnApplyTemplate();
            SetEffectName("亮度效果", "BrightnessEffect");

            blackPointVector2Contrl = GetTemplateChildFormName<Vector2Control>(nameof(blackPointVector2Contrl));
            SetVector2Control(blackPointVector2Contrl, OneEffetData, nameof(BrightnessEffectData.BlackPoint));
            whitePointVector2Contrl = GetTemplateChildFormName<Vector2Control>(nameof(whitePointVector2Contrl));
            SetVector2Control(whitePointVector2Contrl, OneEffetData, nameof(BrightnessEffectData.WhitePoint));
        }

    }
}
